package com.oracle.rentcar.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

    // 字符转日期
    public static Date parse(String strDate) throws ParseException {
        return sdf.parse(strDate);
    }

    // 日期转字符
    public static String format(Date date) {
        return sdf.format(date);
    }
}